﻿using BuddHa.Common.FileExportOpex.Pdf;
using BuddHa.Common.FileExportOpex.Pdf.Example;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace BuddHa.WebTest.Pages
{
    public class IndexModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;

        public IndexModel(ILogger<IndexModel> logger)
        {
            _logger = logger;
        }

        public ReceiptModel Data { get; set; }

        public async void OnGet()
        {
            Data = new ReceiptModel() {
                Title = "宁波信息科技有限公司电子收款凭证",
                ReceiptInfoInputs = new List<ReceiptModel.ReceiptInfoInputsModel>()
            };
            Data.ReceiptInfoInputs.Add(new ReceiptModel.ReceiptInfoInputsModel() { 
                Code = "19071800001", 
                Name = "张三",
                IdNo = "43062619890622xxxx",
                Amount = "22939.43",
                UppercaseAmount = "贰万贰仟玖佰叁拾玖元肆角叁分",
                PaymentMethod = "微信支付",
                TradeStatus = "已完成",
                Remark = "学费",
                Grade = "2019秋",
                Profession = "运动训练",
                TradeTime = new DateTime(2020, 01, 21, 13, 57, 09)
            });

            await Data.ExportZip(new ExportModel[] { Data });
        }
    }
}